package base.juc.list;


import java.util.*;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;

public class D1 {


    public static void main(String[] args) {
        List<String> list = new CopyOnWriteArrayList<>();
        Set<String> list2  = new CopyOnWriteArraySet<>();
        Map<Object, Object> map = new ConcurrentHashMap<>();
        for (int i = 0; i < 30; i++) {
            new Thread(()->{
                // 添加元素
                list.add(UUID.randomUUID().toString().substring(0,3));
                // 获取元素
                System.out.println(list);
            }).start();
        }
    }
}
